<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.List" %>
<%@ page import="com.westos.haohanbang.bean.Haohan" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    List<Haohan> list = (List) application.getAttribute("haohan");
    String id = request.getParameter("id");
    if (list == null) {
        list = new ArrayList();
    }
    for (Haohan hh : list) {
        if (hh.getId().equals(Integer.valueOf(id))) {
            pageContext.setAttribute("hh", hh);
            break;
        }
    }
    Haohan hh = (Haohan) pageContext.getAttribute("hh");
%>
<html>
<head>
    <title>修改</title>
</head>
<form name="form1" action="./updateServlet">
    序号:<input type="text" name="id" value="<%=hh.getId()%>" placeholder="请输入序号"/>
    姓名:<input type="text" name="name" value="<%=hh.getName()%>" placeholder="请输入姓名"/>
    <button type="submit">修改</button>
</form>
</body>
</html>
